<template>
	<view class="error-info">
		<view class="errorinfo-wrapper">
			<view class="err-title">
				<text class="err-main">故障描述：</text>
				{{formData.description}}
			</view>
			<view class="err-title" style="padding-top: 10px;">
				<text class="err-main">故障级别：</text>
				{{formData.level}}
			</view>
		</view>
		<view class="errorinfo-text">
			<view class="info-text-center">解决方案</view>
			<view class="text-wrapper">
				<rich-text :nodes="formData.content"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	import jshopContent from '@/components/jshop/jshop-content.vue' //视频和文本解析组件
	export default {
		data() {
			return {
				arr:{},
				description:"",
				info:"",
				level:"",
				formData:""
			}
		},
		methods: {
			
		},
		components:{
			jshopContent
		},
		onLoad(options){
			if(options.address) {
				let aa = options.address;
				let bb = decodeURIComponent(aa)
				this.formData = JSON.parse(bb);
				console.log(this.formData)
				this.formData.content = this.formData.info.replace(/\<img/gi, '<img style="max-width:100%;height:auto;margin:0 auto;width: 100%;"').replace(/\<table/gi, '<table style="width: 100%;"')
			// this.formData.content = this.formData.info.replace(/\<table/gi, '<table style="width: 100%;"'); //图片自适应问题
			
			  // richText = richText.replace(/\<img/gi,'<img style="width:100%;height:auto;"').replace(/\<p>/gi, '<p class="p_class">')
			}
			
		}
	}
</script>

<style scoped>
	.error-info{
		width: 100%;
	}
	page {
		background-color: #FFFFFF;
		min-height: 100%;
	}
.errorinfo-wrapper{
	background-color: #F9F9F9;
	padding: 19px 16px 14px 16px;
}
.err-title{
font-size: 16px;color: #333333;font-weight: bold;
}
.err-main{
	font-size: 14px;color: #999999;
	font-weight: normal;
}
.errorinfo-text{
	padding: 8px 16px 8px 16px;
}
.info-text-center{
	font-size: 14px;
	color: #333333;
	text-align: center;
}
.info-text{
	color: #999999;
	font-size: 12px;
}
.info-main{
	color: #333333;
	font-size: 14px;
	padding-top: 3px;
}
.text-item{
	padding-top: 12px;
}
.text-wrapper >>>table{
	width: 100% !important;
}
.text-wrapper >>>img{
	width: 100% !important;
}
</style>
